<%@ include file="/includes.jsp" %>
<%@ include file="/header.jsp" %>

<h2>Events</h2>

<table>
    <thead>
    <tr>
        <th>Event</th>
        <th>Administrator</th>
        <th>Location</th>
        <th>Start Time</th>
        <th>End Time</th>
    </tr>
    </thead>
    <c:if test="${empty eventList}">
        <tr>
            <td colspan="5">
                No events meet the selection criteria.
            </td>
        </tr>
    </c:if>
    <c:if test="${not empty eventList}">
        <c:forEach var="event" items="${eventList}">
            <tr>
                <td><a href="details?id=${event.id}">${event.name}</a></td>
                <td>${event.administrator.firstName} ${event.administrator.lastName}</a>
                </td>
                <td>${event.location}</td>
                <td>${event.startTime}</td>
                <td>${event.endTime}</td>
            </tr>
        </c:forEach>
    </c:if>
</table>

<%@ include file="../footer.jsp" %>
